<template>
	<view class="income-item">
		<view class="title-wrapper">
			<view class="title">{{ info?.title }}</view>
			<view class="detail" @click="checkDetail">
				<text>收入详情</text>
				<uni-icons type="right" :size="16" color="#7B7B7B"></uni-icons>
			</view>
		</view>
		
		<view class="income" v-if="info?.status == 8">总收入：¥{{ info?.money }}</view>
		<view class="income" v-else>当前收入：¥{{ info?.money }}（活动未结束）</view>
		<view class="activity" v-if="info?.status != 8">活动进行中</view>
		<view class="date-time" v-else>{{ info?.activity_date_end }}</view>
	</view>
</template>

<script>
	export default {
		props: {
			info: {
				type: Object,
				default() {
					return {}
				}
			},
			dateTime: '',
		},
		data() {
			return {
				
			}
		},
		methods: {
			checkDetail() {
				uni.navigateTo({
					url: '/pages/mine/profit/incomeDetail',
					success: (res) => {
						res.eventChannel.emit('checkIncomeDetail', {'info':this.info,'dateTime':this.dateTime})
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.income-item {
		padding: 32rpx 0;
		border-top: 1px solid #E9E9E9;
		
		.title-wrapper {
			display: flex;
			justify-content: space-between;
			align-items: center;
			.title {
				font-size: 30rpx;
				font-weight: 500;
				max-width: 440rpx;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				overflow: hidden;
				text-overflow: ellipsis;
				line-clamp: 1;
				-webkit-line-clamp: 1;
			}
			.detail {
				display: flex;
				align-items: center;
				color: #7B7B7B;
				font-size: 26rpx;
			}
		}
		.income {
			margin: 24rpx 0 16rpx;
			font-size: 26rpx;
		}
		.activity {
			color: $uni-color-primary;
			font-size: 26rpx;
		}
		.date-time {
			font-size: 26rpx;
			color: #7B7B7B;
		}
	}
</style>